package ru.payment.wm.impl;

import org.dom4j.Element;
import ru.payment.wm.Purse;

/**
 *
 * User: sergey
 * Date: 22.04.2009
 * Time: 16:26:37
 *
 */
public class PurseParser extends AbstractResponseParser<Purse, Element> {

  public void parse(Element e, Purse p) throws ProtocolException {
    if (e == null) {
      return;
    }
    
    p.setPurseId(e.attributeValue("id"));

    p.setPurseName(asString(e.element("pursename"), ""));
    p.setAmount(asFloat(e.element("amount"), 0f));
    p.setDescription(asString(e.element("desc"), ""));

  }
  
}
